package com.heima.Config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class EsConfig {
    public static final String EShost="192.168.1.109:9200";

    @Bean
    public RestHighLevelClient esclient()
    {
        return new RestHighLevelClient(RestClient.builder(
                HttpHost.create(EShost)
        ));
    }

}
